package br.com.lh.urabuilder.view.arrow.drawer
{
	import br.com.lh.urabuilder.util.CoordinatesUtils;
	import br.com.lh.urabuilder.view.arrow.ArrowWrapper;
	
	import flash.geom.Point;
	
	public class ArrowContainerDrawer implements IArrowContainerDrawer
	{
		private var startPoint:Point;
		private var endPoint:Point;
		
		
		public function ArrowContainerDrawer(startPoint:Point,endPoint:Point){
			this.startPoint = startPoint;
			this.endPoint = endPoint;
		}
		
		//FIXME: Substituir por css..
		public function get height():Number{
			return 20;
		}
		
		public function get width():Number{
			return CoordinatesUtils.getLineLength(startPoint,endPoint);
		}
		
		public function get initialPoint():Point{
			var startPointRotated:Point = 
				CoordinatesUtils.getRotatedStartPoint(startPoint,height/2,	
				CoordinatesUtils.getAngleInRad(startPoint,endPoint));
				return new Point(startPointRotated.x,startPointRotated.y);
			 
		}
		
		public function get arrowWrapper():ArrowWrapper{
			var relativeStartPoint:Point = new Point(0,height/2);
			var relativeEndPoint:Point = new Point(width,height/2);
			return new ArrowWrapper(relativeStartPoint,relativeEndPoint,false);
		}
		
		
		
	
		

	}
}